﻿using System;
using System.Collections.Generic;
using System.Text;

namespace DataStructureAndAlgorithm.递归
{
    public class TestFeibonaci
    {
        //斐波那契数列 1 1 2 3 5 8 13 21
        /// <summary>
        /// 打印斐波那契数列 第N项
        /// </summary>
        /// <param name="n"></param>
        /// <returns></returns>
        public int Fn(int n)
        {
            if(n == 1 || n == 2)
            {
                return 1;
            }
            else
            {
                return Fn(n - 1) + Fn(n - 2);
            }
        }
    }
}
